/**
 * Created by aa on 2016/10/9.
 */
var utils=require('../common/utils');
var cac=utils.cac;

//获取账户总览
const RECEIVE_MY_MAININFO='RECEIVE_MY_MAININFO';
//获取用户电话
const RECEIVE_MY_PHONE='RECEIVE_MY_PHONE';

//对外暴露变量
exports.RECEIVE_MY_MAININFO=RECEIVE_MY_MAININFO;

exports.RECEIVE_MY_PHONE='RECEIVE_MY_PHONE';

exports.receiveMyPhone = cac(RECEIVE_MY_PHONE, 'myPhone');

exports.submitFeedBack=(suggestion,callBack)=>{
  return (dispatch,getState) => {
    reqwest({
      url: 'api/saveSuggestion',
      method: 'post',
      contentType: 'application/json',
      data: JSON.stringify({
          suggestion: suggestion
      })
    })
        .then(function (data) {
            if(data.resultCode=='200'){
                callBack('提交建议成功');
            }
            else{
                callBack(data.msg);
            }
        })
        .fail(function (err, msg) {
            callBack('获取数据出错');
        })
  }
};

